package com.wb.creational.builder;

/**
 * @author 魏彪
 */
public class ActorController {

    public Actor construct(ActorBuilder ab) {
        ab.buildType();
        ab.buildSex();
        ab.buildFace();
        ab.buildCostume();
        // 通过判断钩子方法来控制产品的扩建
        if (!ab.isBareheaded()) {
            ab.buildHairstyle();
        }
        return ab.createActor();
    }
}
